#include<iostream>
#include<algorithm>
#include<iomanip>

using namespace std;

bool comp(pair<int, int> A, pair<int, int> B)
{
	if (A.second < B.second) return true;
	if (A.second == B.second && A.first < B.first) return true;
	return false;
}

int main()
{
	int n, temp, sum = 0;
	long total_sum = 0;
	pair<int, int> A[1000], temp_pair;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> temp;
		temp_pair = pair<int, int>(i + 1, temp);
		A[i] = temp_pair;
	}
	sort(A, A + n, comp);
	for (int i = 0; i < n; i++)
	{
		cout << A[i].first << " ";
		total_sum += sum;
		sum += A[i].second;
	}
	cout << endl;
	cout << fixed << setprecision(2) << (double)total_sum / n;
	return 0;
}